package com.pattern.design.designpattern.Note;

import com.pattern.design.designpattern.MainActivity;

/**
 * author:harisucici on 2018/10/10 14:51
 * email:harisucici@gmail.com
 * name:
 * todo:
 */
public class Call4Duty {
    private int mCheckpoint = 1;
    private int mLifeValue = 100;
    private String mWeapon = "沙漠之鹰";

    /**
     * Play.
     */
    public void play(){
        MainActivity.systemOut("play:"+String.format("第%d关",mCheckpoint));
        mLifeValue -= 10;
        MainActivity.systemOut("player_up");
        mCheckpoint++;
        MainActivity.systemOut("arrive"+String.format("第%d关",mCheckpoint));
    }

    /**
     * Quit.
     */
    public void quit(){
        MainActivity.systemOut("------");
        MainActivity.systemOut("exit:"+this.toString());
        MainActivity.systemOut("exit!!!");
        MainActivity.systemOut("------");
    }

    /**
     * Creat note note.
     *
     * @return the note
     */
    public Note creatNote(){
        Note note = new Note();
        note.mChickpoint = mCheckpoint;
        note.mLifeValue = mLifeValue;
        note.mWeapon = mWeapon;
        return note;
    }

    /**
     * Restore.
     *
     * @param note the note
     */
    public void restore(Note note){
        this.mCheckpoint = note.mChickpoint;
        this.mLifeValue = note.mLifeValue;
        this.mWeapon = note.mWeapon;
        MainActivity.systemOut("restore:"+this.toString());
    }
}
